Skip to content

Publish a runnable example for ClimbingStairs - #77

Open
hotasourav8-sketch wants to merge 1 commit into
S-AI-Projects:masterfrom
hotasourav8-sketch:student/e26b07f0855/R45-T027
Open

hotasourav8-sketch wants to merge 1 commit into
S-AI-Projects:masterfrom
hotasourav8-sketch:student/e26b07f0855/R45-T027

Conversation

@hotasourav8-sketch

Copy link
Copy Markdown

Description
This PR publishes a runnable demonstration example for ClimbingStairs and establishes a comprehensive test suite. The new main() method provides users with a clear walkthrough of the staircase problem and recurrence relation, while ClimbingStairsTest verifies correctness across all ranges.

Related Issue
Fixes: #27

Type of Change
● Documentation
● New Feature
● Tests

Changes Made

  • Added public static void main(String[] args) to ClimbingStairs.java demonstrating staircase calculation for n = 0..10 with breakdown.
  • Created ClimbingStairsTest.java with base cases, parameterized tests for n = 2..10, and large input verification.
  • Verified recurrence invariant: ways(n) == ways(n-1) + ways(n-2).
  • Verified exception-free execution of main().

Screenshots / Recordings
N/A (Console demo / Backend changes only)

Testing
Executed JUnit 5 test suite:
mvn test -Dtest=ClimbingStairsTest

Checklist
● I have tested my changes locally.
● I have added or updated tests, if needed.
● I have updated documentation, if needed.
● I have followed the project's coding guidelines.
● I have run the relevant tests and checks.
● I have addressed previous review feedback, if applicable.

Additional Notes
The runnable example provides immediate pedagogical value for learners browsing the repository.

Add a runnable main method demonstrating ClimbingStairs usage with:
- Recurrence explanation and step-by-step output for sizes 0..10
- Detailed combinatorial breakdown for n = 4
- Comprehensive unit tests covering base cases, parameterized checks,
  Fibonacci recurrence invariant, and verification of main() execution

Fixes: S-AI-Projects#27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant